﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Dsl.Ped.Framework.Projections.ObjectProjections.Block"
    xmlns:fpc="clr-namespace:Dsl.Ped.Framework.WPFControls.ProjectiveObject"
    xmlns:converters="clr-namespace:Dsl.Ped.Common.Converters;assembly=DSLCommon">

    <converters:OrientationToDockConverter x:Key="orientationToDockConverter" />
    
    <Style TargetType="{x:Type local:BlockProjection}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:BlockProjection}">
                    <StackPanel Orientation="{TemplateBinding Orientation}">
                        <DockPanel DockPanel.Dock="Top">
                            <ContentPresenter 
                                Name="PART_HeaderProjection"
                                DockPanel.Dock="Left"
                                VerticalAlignment="Center"/>
                            <Label Content="{TemplateBinding StartTag}"
                                   DockPanel.Dock="Left"
                                   Background="{TemplateBinding Background}"
                                   BorderBrush="{TemplateBinding BorderBrush}"
                                   BorderThickness="{TemplateBinding BorderThickness}"
                                   Foreground="{TemplateBinding Foreground}"
                                   FontFamily="{TemplateBinding FontFamily}"
                                   FontSize="{TemplateBinding FontSize}"
                                   FontStyle="{TemplateBinding FontStyle}"
                                   FontStretch="{TemplateBinding FontStretch}"
                                   FontWeight="{TemplateBinding FontWeight}"/>
                        </DockPanel>
                        <ContentPresenter DockPanel.Dock="{TemplateBinding Orientation, Converter={StaticResource orientationToDockConverter}}"
                                          x:Name="PART_Content"
                                          VerticalAlignment="Center"/>
                        <Label Content="{TemplateBinding EndTag}" 
                               DockPanel.Dock="{TemplateBinding Orientation, Converter={StaticResource orientationToDockConverter}}"
                               Background="{TemplateBinding Background}"
                               BorderBrush="{TemplateBinding BorderBrush}"
                               BorderThickness="{TemplateBinding BorderThickness}"
                               Foreground="{TemplateBinding Foreground}"
                               FontFamily="{TemplateBinding FontFamily}"
                               FontSize="{TemplateBinding FontSize}"
                               FontStyle="{TemplateBinding FontStyle}"
                               FontStretch="{TemplateBinding FontStretch}"
                               FontWeight="{TemplateBinding FontWeight}"/>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>